<!DOCTYPE html>
<html>
<head>
	<title></title>
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/jquery.luara.0.0.1.min.js"></script>
<!-- <script src="__PUBLIC__/js/distpicker.data.js"></script>
<script src="__PUBLIC__/js/distpicker.js"></script> -->
<script src="__PUBLIC__/js/main.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/qh_goods.css">
</head>
<body>
	<div class="qh_header">
		<div class="qh_header_login">您好，欢迎来到灷窍乾商城！</div>
	</div>
	<div class="qh_search">

			<img src="__PUBLIC__/home/images/goods/goods_logo.png" class="qh_search_logo">
			<input type="text" name="name" id = "good_name" style="margin-left:355px">
			<button onClick="xxxx();">搜&nbsp;索</button>
		
			<a href="{:U('Goods/index')}" style="width:140px"><img src="__PUBLIC__/home/images/goods/classify.png" style="width:16px;height:16px;margin-bottom:5px;">&nbsp;&nbsp;全部分类</a>
	<script>
	function xxxx(){

	var name=$('#good_name').val();
	if(name != ""){
		location.href="/Goods/goods_list/name/"+name;
	}else{
		location.href="/Goods/goods_list";
	}

	}
	</script>		
	</div>
	<div class="qh_cart" style="padding:50px;width:1100px;">
		<form>
			<label><span>本次消费金额：</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$allmoney}
				
			</label><br><br>
			<label><span>收货人姓名</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="name" id="name" value="{$address['linkman']}"></label><br><br>
			<label><span>收货人电话</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="phone" id="phone" value="{$address['phone']}"></label><br><br>
			<input type="hidden" name="gid" id="gid" value="{$gid}">
			<input type="hidden" value="{$num}" id="num" /> 
			<span>收货人地址</span>&nbsp;&nbsp;&nbsp;&nbsp;
			 <div data-toggle="distpicker" style="display:inline-block;">
		       <select name="pro" id="pro" >
				<option value="{$address['province_id']}">{$address['province']}</option>
			        <foreach name="region" item="v">
				   		<option value="{$v.area_id}">{$v.area_name}</option>
				    </foreach>
			    </select>
			    <select name="city" id="city">
			        <option value="{$address['city_id']}">{$address['city']}</option>
			    </select>
			    <select name="area" id="area">
			        <option value="{$address['area_id']}">{$address['area']}</option>
			    </select>
				

		        
		      </div>
		      <br><br>

			<input type="" name="address" id="address" style="margin-left:104px;width:500px;height:30px;" placeholder="具体收货地址" value="{$address.address}">

		</form>
	</div>
	<div class="qh_account">
		<div class="qh_account_div">
			<a onClick="sc();" style="margin-right:50px;">提&nbsp;交</a>
		</div>
	</div>
	<!--{:U('Goods/success_complete')} -->

<script>
//用于提交
function sc(){


var name=$('#name').val();
var phone=$('#phone').val();
var address=$('#address').val();
var sheng = $("#pro").val();
var shi = $("#city").val();
var qu = $("#area").val();
var account_type  = $('input[name="account_type"]:checked').val();
if(account_type==""){
	alert("请选择支付方式");return;
}
if(name==""){
	alert("请填写收件人姓名");return;
}
if(phone==""){
	alert("请填写收件人电话");return;
}
if(address==""){
	alert("请填写收货地址");return;
}

var url="{:U('Goods/cart_settlement')}";
$.post(url,{'name':name,'phone':phone,'address':address,"sheng":sheng,"shi":shi,"qu":qu,'account_type':account_type},function(data){
			alert(data.info);
			if(data.status == 1){
				location.href="{:U('Goods/success_complete')}";
			}
});

}
</script>

  <script>
    $('#pro').change(function(){
    	var url = "{:U('Address/Insert')}";
    	var pro_id = $('#pro').val();
    	$.post(url,{'pro_id':pro_id},function(data){
    		 $('#city').html(data);
    	});
    });
    $('#city').change(function(){
    	var url = "{:U('Address/Insert')}";
    	var pro_id = $('#city').val();
    	$.post(url,{'pro_id':pro_id},function(data){
    		 $('#area').html(data);
    	});
    }); 	
</script>
	<!-- //////////////////////////////////////////////////////////////////////////////////////// -->
		
	
	
	<!-- //////////////////////////////////////////////////////////////////////////////////////// -->


	<div class="qh_footer">Copyright 2017-2018 All  灷窍乾 商城 版权所有</div>
</body>
</html>